package entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import group.Email;
import group.Phone;
import group.UserAdd;
import jdk.nashorn.internal.ir.annotations.Ignore;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.sql.Timestamp;
import java.io.Serializable;

/**
 * (Member)实体类
 *
 * @author makejava
 * @since 2021-05-10 14:38:41
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Member implements Serializable {
    private static final long serialVersionUID = -82694318788908255L;
    /**
     * 员工id
     */
    private Integer memberId;
    @NotBlank(message = "验证码不能为空",groups = {Phone.class})
    /**
     * 验证码
     */
    private String code;
    /**
     * 员工姓名
     */
    private String memberName;
    /**
     * 员工姓氏
     */
    private String memberSurname;
    /**
     * 员工名
     */
    private String memberPellation;
    /**
     * 员工头像
     */

    private String memberImg;
    /**
     * 1 男 0女 性别
     */
    private Integer memberSex;
    /**
     * 国籍
     */
    private String memberNational;
    /**
     * 出生日期
     */


    @JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Timestamp memberBirth;
    /**
     * 手机号码
     */
    @Pattern(regexp = "^(0|86|17951)?(13[0-9]|15[012356789]|166|17[3678]|18[0-9]|14[57])[0-9]{8}$",message = "手机号格式不正确",groups = {Phone.class, UserAdd.class})
    private String memberPhone;
    /**
     * 邮件
     */
    @Pattern(regexp = "\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*",message = "邮件格式不正确",groups = {Email.class, UserAdd.class})
    private String memberEmail;
    /**
     * 登录密码
     */

    @NotBlank(message = "密码不能为空",groups = {Email.class})
    private String memberPwd;
    /**
     * 创建时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Timestamp createTime;
    /**
     * 身份证
     */
    private String idCard;
    /**
     * 身份证号码
     */
    @Pattern(regexp = "^(^[1-9]\\d{7}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}$)|(^[1-9]\\d{5}[1-9]\\d{3}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])((\\d{4})|\\d{3}[Xx])$)$",message = "身份证格式不正确",groups = {UserAdd.class})
    private String idCardNum;
    /**
     * 护照
     */
    private String passport;
    /**
     * 护照号码
     */
    private String passportNum;
    /**
     * 军人证
     */
    private String soldierCard;
    /**
     * 军人证号码
     */
    private String soldierCardNum;
    /**
     * 武警证
     */
    private String armedCard;
    /**
     * 武警证号码
     */
    private String armedCardNum;
    /**
     * 通行证
     */
    private String pass;
    /**
     * 通行证号码
     */
    private String passNum;
    /**
     * 户口簿
     */
    private String household;
    /**
     * 户口簿号码
     */
    private String householdNum;
    /**
     * 边境证
     */
    private String border;
    /**
     * 边境证号码
     */
    private String borderNum;
    /**
     * 外国人居留证
     */
    private String foreigner;
    /**
     * 外国人居留证号码
     */
    private String foreignerNum;
    /**
     * 是否删除 0未删除 1已删除
     */

    private Integer isDelete;
    /**
     * 是否禁用 0未禁用 1已禁用
     */

    private Integer memberStatus;
    /**
     * 部门id
     */
    private Integer deptId;
    /**
     * 角色id
     */
    private Integer roleId;
    /**
     * 所在城市id
     */

    private Integer locationCityId;
    /**
     * 常用仓位
     */

    private String position;
    /**
     * 航空公司id
     */

    private Integer airlineId;
    /**
     * 是否为常用旅客
     */

    private Integer isUsual;




    private Role role;

    private City city;

    private Flight flight;

    private Dept dept;
}
